<!DOCTYPE html>
<html lang="en">
<head>
    {include file="public/meta" /}
    {include file="public/link" /}
</head>
<body data-type="index" class="theme-white">
<div class="am-g tpl-g">
    {include file="public/header" /}
    {include file="public/left" /}
    {include file="public/content_top" /}
    <ol class="am-breadcrumb">
        <li><a href="../home/index.html" class="am-icon-home">首页</a></li>
        <li><a href="#">功能权限管理</a></li>
        <li class="am-active">功能列表</li>
        <li><a href="functions_add?a={$a}&b={$b}">添加功能</a></li>
    </ol>
    <div class="widget am-cf">
        <div class="am-form-inline" role="form">
            <span>分类信息：</span>
            <div class="am-form-group ">
                <input type="text" id="name" class="am-form-field am-input-sm" placeholder="请输入分类名称"
                       value="{$name}"/>
            </div>
            <button type="button" class="am-btn am-btn-primary am-btn-sm" onclick="info_query()">查询</button>
            <button type="button" class="am-btn am-btn-warning am-btn-sm" onclick="clear_query()">清除查询</button>
        </div>
        <hr data-am-widget="divider" class="am-divider am-divider-default"/>
        <div class="widget-body widget-body-lg am-fr">
            <div class="am-scrollable-horizontal">
                <table class="{$table}">
                    <thead>
                    <tr>
                        <th>功能ID</th>
                        <th>所属分类</th>
                        <th>名称</th>
                        <th>添加时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="list">
                    {foreach $data as $val}
                    <tr class="text-c">
                        <td>{$val.id}</td>
                        <td>{$val.cate_name.name}</td>
                        <td><a href="functions_add.html?id={$val.id}">{$val.name}</a></td>
                        <td>{$val.time_text}</td>
                        <td>
                            <a href="del.html?id={$val.id}" onclick='return del();'
                               class="am-btn am-btn-warning am-btn-xs">删除</a>
                            <a href="functions_add.html?id={$val.id}" class="am-btn am-btn-success am-btn-xs">修改</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <div class="am-pagination-left">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot" /}
<script type="text/javascript">
    function del() {
        if (confirm("确定要删除吗？")) {
            return true;
        } else {
            return false;
        }
    }

    $(function () {
        var nav = $('.left-sidebar li.sidebar-nav-link');
        nav.removeClass("active");
        nav.eq({$a}).find('ul').show();
        nav.eq({$a}).find('ul li').eq({$b}).find('a').addClass('active');
    });

</script>
</body>
</html>